import { createStore } from 'vuex';
// import vuexPersistedstate from 'vuex-persistedstate'; // vuex-持久化
const modules = {},
  path = [];
// 自动导入vuex模块
const modulesFn = require.context('./modules', true, /\.js$/);
const reg = /\.\/(.*?)\.js$/;
modulesFn.keys().forEach((filePath) => {
  let module = modulesFn(filePath).default;
  module.namespaced = true;
  const regRes = reg.exec(filePath);
  const moduleName = regRes && regRes[1];
  path.push(regRes[1]);
  modules[moduleName] = module;
});
const store = createStore({
  state: {

  },
  getters: {

  },
  mutations: {

  },
  actions: {},
  modules,
});

export default store;
